package com.atguigu.securitydemo.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
public class FirstController {
//    @PreAuthorize("hasRole('ROLE_KJL')")
    @RequestMapping("/kjl.do")
    @ResponseBody
    public String method1(){
       return "hello,my name is 柯家乐";
    }
    @RequestMapping("/method2")
    @ResponseBody
    public String method2(@RequestParam(value = "str") String str){
        return "hello,my name is 钟冰涛";
    }
    @RequestMapping("/method3")
    public String method3(){
        return null;
    }
}
